Chinese remainder theorem - based computation method for cryptosystems

ABSTRACT

A computer hardware implemented cryptography method computes a modular exponentiation, M:=C d  (mod p·q) upon a message data value C using a Chinese Remainder Theorem (CRT) based technique. To secure against cryptanalysis,, the private key moduli p and q are transformed by multiplication with a generated random value s, so that p′:=p·s and q′:=q·s. The CRT steps of the modular exponentiation are applied using the transformed moduli p′ and q′ to obtain a random intermediate message data value M′. A final reduction of M′ modulo p·q yields the final message data value M. Values needed for the computation are loaded into data storage and accessed as needed by electronic processing hardware.

TECHNICAL FIELD

The present invention relates to cryptographic methods carried out in electronic processing hardware with associated software. In particular, the invention relates to cryptographic computations performed by such electronic processing hardware that involve finite field, residue or congruence operations, and especially modular exponentiation calculations employing Chinese Remainder Theorem based techniques, with attention to variations for thwarting cryptanalysis.

BACKGROUND ART

Many cryptographic algorithms are based on modular exponentiation calculations of the type m≡c^(d) (mod n) , where c and m can correspond to data of various kinds (plaintext and ciphertext messages, signatures, message digests, authentication codes, etc.) and where d and n cat correspond to elements of public or private keys for operating upon that data. The modulus n is usually the product of two very large primes p and q that are kept secret. The RSA algorithm is one example of an encryption system (and related digital signature scheme) that uses modular exponentiation. The Diffie-Hellman key agreement protocol is another.

In the RSA algorithm, a public key {e, n} and a corresponding private key {d, p, q} are provided for encryption and decryption, where d·e≡1 (mod φ(n)), n=p·q, φ(n)=(p-1) (q-1), and where integer e and φ(n) are co-prime. Alternatively, a function λ(n)=LCM(p-1,q-1) is often used in place of the original φ (n). (RSA PKCS#1 v.2.1) For encryption a ciphertext c may be obtained from a plaintext message m using the public key {e, n} according to the relation c=m^(e) (mod n). The public key exponent e is usually a small value (e.g., 3, 5, 35, or 2¹⁶+1=65537) chosen for ease and speed of encryption. For decryption, the plaintext message m may be recovered from the ciphertext c using the private key {d, p, q} according to the relation m≡c^(d) (mod (p·q)).

The Chinese Remainder Theorem (CRT) is often used to speed the modular exponentiation calculations involved in the decryption, since the otherwise secret prime factors p and q are known to the user. That theorem generally states that given a set of simultaneous congruences x≡a_(i) (mod n_(i)), for i=1 to r, and for which the moduli n_(i) are pairwise relatively prime, the solution is x≡[Σ_(i) a_(i)·b_(i) (N/n_(i))] (mod N), where N=n_(i)·n₂·−n_(r) and the b_(i) are determined from b_(i) (N/n_(i))≡1 (mod n_(i)). For two relatively prime positive integers p and q and two integers a and b (i.e., the case r=2), there exists an integer m uniquely determined modulo p·q, such that m≡a (mod p)≡b (mod q). That is, for GCD (p, q)=1, every pair of residue classes modulo p and q corresponds to a simple residue class modulo p·q. The solution finds m≡[a·(q⁻¹ mod p)·q+b·(p⁻¹ mod q)·p] (mod p·g). A modular inverse of an integer x⁻¹ modulo z is defined such that x·x⁻¹≡1 (mod z). For a prime modulus, every nonzero integer not a multiple of the modulus has an inverse.)

CRT implementation of the RSA algorithm calculates the modular exponentiation m:=c^(d) (mod (p·q)) as follows. First define a pair of private key derived exponents as d₁:=d (mod (p-1)) and d₂:=d (mod (q-1)). Then, calculate m₁:=c^(d) ¹ (mod p) and m₂:=c^(d) ² (mod q).

Finally, m=CRT(m₁, m₂):=m₁+p·{[(m₂−m₁)·R] (mod q)}, where R≡p⁻¹ (mod q).

That last formula of the CRT implementation, namely m=CRT(m₁,m₂), has many variants. Three examples of these variants are:

CRT₂ (m₁,m₂):=(m₁·R₁·q+m₂·R₂·p) (mod p·q), where R₁≡q⁻¹ (mod p) and R₂≡p⁻¹ (mod q); CRT₃(m₁,m₂):={[(m₁·R₁)(mod p)]·q+[(m₂·R₂) (mod q)]·p]} (mod p·q), where again R₁≡q⁻¹ (mod p) and R₂≡p⁻¹ (mod q); and CRT₄ (m₁,m₂):=(q·{[(m₁-m₂)·R₄] (mod p)}+m₂) (mod p·g), where R₄≡p⁻¹ (mod q).

Variant CRT implementations perform the modular exponentiation calculation in ways designed to thwart cryptanalysis, especially in the context of tokens (e.g., smart cards) where an attacker has access to the hardware carrying out the cryptographic computations. An attacker may employ noninvasive measurement and timing analysis of electromagnetic emissions, power consumption, or other accessible parameters of a device during computational processes in order to extract useful information regarding the private keys. The variant implementations typically employ pseudo-random variables at various stages of the cryptographic algorithm in order to mask the underlying mathematical operations without affecting the final result.

For example, in CRT implementations of modular exponentiation, some variants transform the message variable m or its CRT components, m₁ and m₂, by multiplying with a random value at some early stage in the computational process then at a later stage divide the message variable by that same random value or by a related value derived from it to obtain the true result. Other variants may transform the private key exponent d or its CRT components, d₁ and d₂, by adding a random multiple of (p-1) or (q-1) to obtain another (random) member of the congruence class for that private key component. The private key exponent d could likewise be reduced to transformed CRT components, d₁′ and d₂′, using moduli that are corresponding random multiples of (p-1) and (q-1), respectively. In all these cases, the design of the transformations are chosen to obtain a true final result, while randomly varying the intermediate calculations in a manner that take advantage of equivalences in congruence arithmetic. Unfortunately, many of these variants can be quite complex and computationally intense.

SUMMARY DISCLOSURE

The present invention is a computer hardware-implemented cryptography method using Chinese Remainder Theorem (CRT) implemented modular operations, in which a modulus for the computations is transformed in order to blind cryptoanalytic observations of intermediate results. In particular, for a modular exponentiation operation, m=c^(d) (mod p·q), a transformation factor s is used to transform the co-prime factors p and q into p′=s·p and q′=s·q. The CRT steps are applied using the transformed moduli p′ and q′. After obtaining an intermediate result m′, the final result m is recovered by a final reduction modulo p·q. The transformation factor s may be a random value, a random choice from a finite set of preselected fixed values, or, if security is not an issue in a given circumstance, could even be a fixed value. The method is relatively simple and less computational intense than many other variants, yet is still substantially secure against cryptanalysis. Hence, it is suitable for use in smart cards and other cryptographic token applications. It can be employed with any cryptographic algorithm that relies on modular exponentiation with CRT implementations.

The method may he implemented as a cryptography program in data processing hardware, such as smart card or other token, that comprises a cryptographic processor unit, data storage accessible to that processor unit, and pseudo-random number generating circuitry providing the random factor.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic plan view of exemplary processor hardware for use in executing a cryptography method in accord with the present invention, including CRT-based modular exponentiation.

FIG. 2 is a flow diagram illustrating the general steps for modular exponentiation in accord with an exemplary embodiment of the present invention.

DETAILED DESCRIPTION

With reference to FIG. 1, the cryptographic method of the invention may be implemented in a wide variety of digital processing systems, logic circuitry or electronic hardware, or by executing an equivalent firmware or software program in a data processor or computer. Exemplary computational processor hardware in accord with the present invention may include an arithmetic-logic unit (ALU) 10, or similar computational circuitry containing a hardware multiplier, for executing numerical operations, including modular exponentiation, upon provided data. The ALU 10 generally has access to a memory (RAM) 12 and various working registers 14. An operation sequencer 16 comprises logic circuitry for controlling the ALU, including data transfers to and from the memory 12 and registers 14, in accord with firmware or software instructions for the set of operations of a cryptographic algorithm. operation sequencer 16 may access operation parameters in the form of pointers stored in registers 18 that enable the operation sequencer 16 to locate an operand within the RAM 12, as well as other control information and the destination addresses of intermediate results. The hardware may also include a pseudo-random number generator (PRNG) circuit 20 that performs calculations and outputs a random numerical value. This random generator 20 may be accessed by the ALU 10, as directed by the operation sequencer in accord with the cryptographic algorithm and especially modular exponentiation steps thereof.

With reference to FIG. 2, an exemplary CRT-based modular exponentiation computation, M:=C^(d) (mod (p·g)), by the aforesaid hardware and in accord with the present invention typically begins (step 10) by loading the private key values {d, p, q} into data storage accessible to the processing hardware, such as into the RAM 12 in FIG. 1. From there, the values can be transferred as needed into working registers 14 for use by the ALU 10. A random qenerator, such as the PRNG circuit 20 in FIG. 1, generates a random value for the transformation factor s (step 11) which is then used to randomize the private key modulus values p and q by means of multiplication transformations (step 12):

p′:=p·s;

q′:=q·s.

An inverse value R′:=(p′)⁻¹ mod q is calculated (step 14) by the processing hardware in a manner similar to calculations of inverse R:=p⁻¹ (mod q) known in prior versions of CRT-based modular exponentiation.

These transformed values p′ and q′ and the inverse R′, will be used in later steps. Each decryption session using the private key values {d, p, q} will involve a different random value s, and hence different randomized values of the moduli p′ and q′ and of the inverse R′, thereby securing cryptographic operations involving the modular exponentiation from cryptanalysis. (Note: The random value s must be co-prime with the original moduli p and q, so a standard divisibility test for co-primality should be a part of the random generation step 11 in order to weed out any unsuitable random values.) If desired, the size of the random value s may be selected to be within a specified range, so that the values p′, q′, d₁ and d₂ will be substantially the same size.

Alternatively, the transformation factor S could be a random choice from a finite set of preselected fixed values, instead of being randomly generated from scratch for each session. This can save substantial processing time, especially if p′, q′, and R′ are also precomputed for each possible choice of s in the set. If for any reason, cryptographic security is deemed not to be an issue in a given circumstance, the choice of factor s, and hence of p′, q′, and R′, could be a fixed value.

CRT exponents d₁ and d₂ are computed (step 14) from private key exponent d in the same manner as known in prior versions of CRT-based modular exponentiation, i.e.:

d ₁ :=d (mod (p-1));

d ₂ :=d (mod (q-1)).

If desired, this step could also be conveniently placed before the randomization of p and q, i. e. before step 12. Indeed, since the CRT exponents d₁ and d₂ are directly related only to the private key values d, p, and q, they can be pre-computed and loaded into the hardware data storage in place of private key exponent d, in step 10, eliminating step 16 from the session computations.

The variable C for the modular exponentiation is loaded (step 18) into data storage accessible by the processing hardware, e.g., into the RAM 12 of FIG. 1. From there it may be transferred as needed to working registers 14 for use by the ALU 10, usually as blocks of known size in accord with a cryptographic program. The variable C typically represents a ciphertext message to be decrypted; but could represent other cryptographic data, such as a digital signature. As with the computation of the CRT exponents d₁ and d₂, the particular place in the program sequence in which this step occurs can vary, as long as it is available by the time it is needed in step 20.

The CRT steps (steps 20 and 22) are applied, using the transformed moduli p′ and q′ and transformed inverse R′, so as to obtain an intermediate message result M′. In particular, in step 20, CRT message components M₁′ and M₂′ are computed by the processing hardware in a manner similar to that known from prior CRT-based modular exponentiation operations, but using p′ and q′ as the moduli instead of the original private key modulus values p and q. That is,

M ₁ ′:=C ^(d) ¹ (mod p′); and

M ₂ ′:=C ^(d) ² (mod q′).

Then the intermediate message result M′ is computed (in step 22) by the processing hardware from the CRT message components M₁′ and M₂′ using the Chinese Remainder Theorem:

M′:=M ₁ ′+p′·{[(M ₂ ′-M ₁′)·R′] (mod q′)}.

Note that since p′ and q′ are randomized for each decryption session, the values M₁′, M₂′ and M′ are likewise randomized in each session, thwarting cryptanalysis by known text attacks (e.g., repeated use by an attacker of a known value C) and other cryptanalysis techniques that may rely upon eavesdropping on hardware emitted parameters (EM emissions, time-dependent power consumption, etc.). The computations are different each time in a random way, yet are not much more computationally intensive than the straightforward application of CRT-based modular exponentiation.

The intermediate result M′ has been obtained by applying an adapted CRT formula for CRT(M₁′,M₂′). Other variant CRT formulae (such as the three examples given in the Background Art section) can be applied instead, if adapted with the appropriate transformations. To transform an initial CRT formula, the general rule is to always set p′:=p·s and q′:=q·s. For all parts of the formula, like R₁:=q⁻¹ (mod p) and R₂:=p⁻¹ (mod q), we transform to R₁′:=(q′)⁻¹ (mod p) and R₂′:=(p′)⁻¹ (mod q). If p or q appears as a multiply factor in the formula, change it to p′ or q′, respectively. If p or q appears as a modulus, (mod p) or (mod q), we change it to (mod p′) or (mod q′). For example, the CRT exponents, d₁ and d₂, are always d₁:=d (mod (p-1)) and d₂:=d (mod (q-1)). However, the CRT message components M₁′ and M₂′ are always transformed using p′ and s′ as moduli, per the invention, as described above. Thus, for the three exemplary variants, we obtain:

M′=CRT ₂′ (m ₁ ′,m ₂′):=(m ₁ ′·R ₁ ′·q′+m ₂ ′·R ₂ ′·p′)(mod p′·q′),

M′=CRT ₃′ (m ₁ ′,m ₂′):={[(m ₁ ′·R ₁′) (mod p′)]·q′+[(m ₂′·₂′) (mod q′)]·p′} (mod p′·q′),

M′=CRT ₄′ (m ₁ ′,m ₂′):=q′·{[(m ₁′-m ₂′)·R ₄′] (mod p′)}+m ₂′.

Once the intermediate message result M′ is obtained, it may be easily reduced to the final message M by a basic modular reduction operation (step 24):

M:=M′(mod(p·q)):=M′ (mod n).

This final reduction modulo p·q applies to all variants. Note that the product p·q has previously been computed as part of key generation, and is simply the public key modulus n available to all parties. Thus, it need not be recomputed if n has also been loaded into data storage available to the hardware processor, such as in association with previous step 10. Moreover, since use of the public key modulus n does not reveal anything about the private keys, the final reduction can be computed without random transformations and still be secure from cryptanalysis. The final message M is the same, even though p′, q′, M′, etc. are random, since using a transformed modulus that is a random multiple s of the original modulus produces intermediate results that, while random, are still of the same congruence class as that found by using untransformed moduli. 

1. A cryptographic method implemented in an electronic processing system for performing modular exponentiation computations, comprising: loading private key values, including at least one private key exponent and two private key moduli, into a data storage accessible to electronic processing hardware; selecting, by the electronic processing hardware, a transformation factor; multiplying, by the electronic processing hardware, the private key moduli by the transformation factor to produce transformed moduli; loading a first data value into the data storage at any time prior to performing modular exponentiation; performing, by the electronic processing hardware, a modular exponentiation upon the first data value using the at least one private key exponent and the transformed moduli to obtain an intermediate data value; and reducing, by the electronic processing hardware, the intermediate data value modulo a product of the two private key moduli to obtain a final data value.
 2. The method as in claim 1, wherein the transformation factor is a different random value that is generated in a random generating circuit for each execution of the method.
 3. The method as in claim 1, wherein the transformation factor is randomly selected from a finite set of preselected fixed values.
 4. The method as in claim 1, wherein the selected transformation factor is a fixed value.
 5. The method as in claim 1, wherein performing modular exponentiation is executed using a Chinese Remainder Theorem (CRT) calculation of the intermediate data value.
 6. The method as in claim 5, wherein a pair of CRT exponents are computed from a single private key exponent as part of the performing the modular exponentiation.
 7. The method as in claim 5, wherein a pair of CRT exponents are pre-computed from a single private key exponent, the pair of CRT exponents being loaded as private key exponents into the data storage.
 8. The method as in claim 1, wherein the product of the two private key moduli is pre-computed as a public key modulus, the public key modulus also being loaded into the data storage for subsequent use in the reducing of the intermediate data value.
 9. The method as in claim 1, wherein the first data value represents a ciphertext message, the modular exponentiation is executed in the electronic processing hardware as part of a cipher program, and the final data value represents a decrypted plaintext message.
 10. A cryptographic method implemented in an electronic processing system for performing modular exponentiation computations, comprising: loading at least one private key exponent d and two private key moduli p and q, into a data storage accessible to electronic processing hardware; selecting, by the electronic processing hardware, a transformation factor s; multiplying, by the electronic processing hardware, the private key moduli by the transformation factor to produce transformed moduli p′:=p·s and q′:=q·s; computing, by the electronic processing hardware, an inverse value R′:=(p′)⁻¹ (mod q); loading a first data value C into the data storage at any time prior to performing modular exponentiation; performing a modular exponentiation upon the first data value C using the at least one private key exponent d and the transformed moduli p′ and q′ to obtain an intermediate data value M′, wherein performing modular exponentiation is executed by the electronic processing hardware using a Chinese Remainder Theorem (CRT) calculation of the intermediate data value involving: (a) computing CRT exponents d₁:=d (mod p-1) and d₂:=d (mod q-1), (b) computing CRT message components M_(1′:=C) ^(d) ¹ (mod p′) and M₂′:=C^(d) ² (mod q′), and (c) computing an intermediate data value M′ from the CRT message components M₁′ and M₂′; and reducing, by the electronic processing hardware, the intermediate data value M′ modulo a product of the two private key moduli, n=p·q, to obtain a final data value M:=M′ (mod n).
 11. The method as in claim 10, wherein the transformation factor s is a different random value that is generated for each execution of the method.
 12. The method as in claim 10, wherein the transformation factor s is randomly selected from a finite set of preselected fixed values.
 13. The method as in claim 10, wherein the selected transformation factor s is a fixed value.
 14. The method as in claim 10, wherein the CRT exponents are pre-computed from the private key exponent d and loaded as a pair of private key exponents d₁ and d₂ into the data storage.
 15. The method as in claim 10, wherein M′:=M₁′+p′·{[(M₂′-M₁′)·R′] (mod q′)} and R′:=(p′)⁻¹ (mod q).
 16. The method as in claim 10, wherein M′:=(m₁′·R₁′·q′+m₂′·R₂′·p′) (mod p′·q′), R₁′:=(q′)⁻¹ (mod p) and R₂′:=(p′)⁻¹ (mod q).
 17. The method as in claim 10, wherein M′:={[(m₁′·R₁′) (mod p′)]·q′+[(m₂′·R′) (mod q′)]·p′} (mod p′·q′), R₁′:=(q′)⁻¹ (mod p) and R₂′:=(p′)⁻¹ (mod q).
 18. The method as in claim 10, wherein M′:=q′·{[(m₁′-m₂′)·R₄′] (mod p′)}+m₂′ and R₄′:=(p′)⁻¹ (mod q).
 19. The method as in claim 10, wherein the product n=p·q is pre-computed and loaded into the data storage for subsequent use during the reducing of the intermediate data value.
 20. The method as in claim 10, wherein the first data value represents a ciphertext message, the modular exponentiation is executed in the electronic processing hardware as part of a cipher program, and the final data value represents a decrypted plaintext message. 